const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const testSchema = new mongoose.Schema({
  //试卷标题
  title: {
    type: String,
    required: [true, "you must tell us your  title"],
  },

  //试卷题目
  questions: {
    type: Array,
    required: [true, "you must tell us your questions"],
  },
  //试卷类型   unpublish  publishing published
  type: {
    type: String,
    enum: ["unpublish", "publishing", "published"],
    required: [true, "you must tell us your type"],
  },
  //试卷创建时间
  time: {
    type: String,
    required: [true, "you must tell us your time"],
  },
});

const Test = mongoose.model("Test", testSchema);
module.exports = Test;
